<?php

class OperationName
{
    const Action = 'a';
    const SubAction = 'sa';
}

class ActionOperation
{
    const Update = 'update';
    const Post = 'post';
}

interface IInputValues
{
    /**
     * @abstract
     * @param string $name
     * @return string
     */
    function GetValue($name);

    /**
     * @abstract
     * @param string $name
     * @return bool
     */
    function HasValue($name);
}

interface IPageInput
{
    /**
     * @abstract
     * @return IInputValues
     */
    public function Get();

    /**
     * @abstract
     * @return IInputValues
     */
    public function Post();
}

class PageInput implements IPageInput
{
    private $get;
    private $post;

    public function __construct()
    {
        $this->get = new GetInputValues();
        $this->post = new PostInputValues();
    }

    /**
     * @return IInputValues
     */
    public function Get()
    {
        return $this->get;
    }

    /**
     * @return IInputValues
     */
    public function Post()
    {
        return $this->post;
    }
}

class PageInputStub implements IPageInput
{
    /** @var IInputValues */
    private $get;

    /** @var IInputValues */
    private $post;

    /**
     * @param string[] $get
     * @param string[] $post
     */
    public function __construct($get, $post)
    {
        $this->get = new InputValuesStub($get);
        $this->post = new InputValuesStub($post);
    }

    /**
     * @return IInputValues
     */
    public function Get()
    {
        return $this->get;
    }

    /**
     * @return IInputValues
     */
    public function Post()
    {
        return $this->post;
    }
}

class InputValuesStub implements IInputValues
{
    /**
     * @var string[]
     */
    private $inputValuesArray;
    
    /**
     * @param string[] $inputValuesArray
     */
    public function __construct($inputValuesArray)
    {
        $this->inputValuesArray = $inputValuesArray;
    }
        
    /**
     * @param string $name
     * @return string
     */
    function GetValue($name)
    {
        return $this->inputValuesArray[$name];
    }

    /**
     * @param string $name
     * @return bool
     */
    function HasValue($name)
    {
        return isset($this->inputValuesArray[$name]);
    }
}

class GetInputValues implements IInputValues
{
    /**
     * @param string $name
     * @return string
     */
    function GetValue($name)
    {
        return $_GET[$name];
    }

    /**
     * @param string $name
     * @return bool
     */
    function HasValue($name)
    {
        return isset($_GET[$name]);
    }
}

class PostInputValues implements IInputValues
{
    /**
     * @param string $name
     * @return string
     */
    function GetValue($name)
    {
        return $_POST[$name];
    }

    /**
     * @param string $name
     * @return bool
     */
    function HasValue($name)
    {
        return isset($_POST[$name]);
    }
}

?>